package uy.com.nfc.localassigner.dialogs;

import uy.com.nfc.localassigner.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.nfctagcommons.classes.VigilancePoint;

public class ViewPointDetailDialog {

	private Activity activity;
	private VigilancePoint point;

	public ViewPointDetailDialog(Activity activity, VigilancePoint point) {
		this.activity = activity;
		this.point = point;
	}

	public void showPopup() {
		LayoutInflater inflater = activity.getLayoutInflater();
		View localDetailLayout = inflater.inflate(R.layout.view_local_details,(ViewGroup) activity.findViewById(R.layout.view_local_details));
		Typeface customTypeface = Typeface.createFromAsset(activity.getAssets(), "fonts/AliquamREG.ttf");
		TextView localName = (TextView)localDetailLayout.findViewById(R.id.localName);
		TextView localHours = (TextView)localDetailLayout.findViewById(R.id.localHours);
		TextView localDescription = (TextView)localDetailLayout.findViewById(R.id.localDescription);
		
		localName.setTypeface(customTypeface);
		localHours.setTypeface(customTypeface);
		localDescription.setTypeface(customTypeface);
		
		localName.setText(point.getLocalName());
		localHours.setText("de "+point.getHourFrom()+" : 00 a "+point.getHourTo()+" : 00");
		localDescription.setText(point.getLocalDescription());
		
		new AlertDialog.Builder(activity)
			.setView(localDetailLayout)
			.setPositiveButton("Aceptar", null)
			.create()
			.show();
	}

}
